<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/7/13
 * Time: 14:44
 */

namespace app\admin\controller\mall;


use app\common\controller\AdminController;
use think\app;

class Coupon extends AdminController
{
    public function __construct(App $app)
    {
        parent::__construct($app);

    }

    /**
     * 异步获取数据
     * @param Request $request
     * @return array|\Illuminate\Contracts\View\Factory|\Illuminate\View\View|mixed|\think\response\View
     */
    public function getData()
    {

        $this->request->filter(['strip_tags']);

        $res = [
            [
                'id'=>1,
                'cate'=>'满减券',
                'content'=>'满100减20',
                'store'=>'清远教育',
                'start_time'=>'2020-07-16',
                'end_time'=>'2020-07-30',
                'price'=>'9.9',
                'number'=>'25/199',
                'status'=>1,
                'state'=>1,
                'create_time'=>'2020-07-15',
                'username'=>'啧啧啧',
                'phone'=>15845600071,
            ],
            [
                'id'=>1,
                'cate'=>'满减券',
                'content'=>'满200减50',
                'store'=>'思聪教育',
                'start_time'=>'2020-07-16',
                'end_time'=>'2020-07-30',
                'price'=>'18.8',
                'number'=>'35/99',
                'status'=>2,
                'state'=>1,
                'create_time'=>'2020-07-15',
                'username'=>'哇哈哈',
                'phone'=>15945610304,
            ],
            [
                'id'=>1,
                'cate'=>'满减券',
                'content'=>'满500减100',
                'store'=>'哈哈教育',
                'start_time'=>'2020-07-16',
                'end_time'=>'2020-07-30',
                'price'=>'68',
                'number'=>'150/200',
                'status'=>0,
                'state'=>1,
                'create_time'=>'2020-07-15',
                'username'=>'可笑',
                'phone'=>15945655555,
            ],
        ];

        $data = [
            'code' => 0,
            'msg' => '正在请求中...',
            'count' => 1,
            'data' => $res,
        ];
        return json($data);
    }
}